@php
$cat_id = 19;
$count = 1;
@endphp
@extends('.app.layout')

@section('title','人才政策')
@section('head')
    <link href="/code/css/main.css" rel="stylesheet" />
    <link href="/code/css/base.css" rel="stylesheet" />
    <script type="text/javascript" src="/code/js/tab1.js"></script>

    <script>
        $(document).ready(function(){
            $(".mui-list").click(function(){
                $(".pop").toggle();
            })
            $(".pop li").click(function(){
                $(".pop").hide();
            })
        })
    </script>
@endsection
@section('content')
    <header class="mui-bar mui-bar-nav">
        <span class="mui-pull-left return" onclick="aOfApp('{{url('/app')}}',true)">
            <img src="/code/images/back.png" />
        </span>
        <h1 class="mui-title">人才政策</h1>
    </header>
    @include('.app.partial.foot-tab',['active'=>'人才政策'])
    <div class="mui-content mui-top">
        <div class="line"></div>
        <div class="new-list-wrap scroll-wrapper mui-scroll-wrapper scroll-special no-tab-special">
            <div class="mui-scroll">
            <div class="slider-wrap ">
                <div id="slider" class="mui-slider">
                    <div class="mui-slider-group mui-slider-loop">
                        <!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
                        @php
                            $slide =\App\Post::getRecommendPost($cat_id);
                            $c = count($slide);
                        @endphp
                        @if($slide)
                            <div class="mui-slider-item mui-slider-item-duplicate">
                                <a href="javascript:aOfApp('{{route('app.post-index',['id'=>$slide[$c-1]['id']])}}')">
                                    <img src="{{asset('storage/'.$slide[$c-1]['thumb'])}}">
                                    <p class="mui-slider-title mui-ellipsis">{{$slide[$c-1]['post_title']}}</p>
                                </a>
                            </div>
                            @foreach($slide as $k=>$v)
                                <div class="mui-slider-item {{$loop->first?'mui-slider-item-duplicate':''}}">
                                    <a href="javascript:aOfApp('{{route('app.post-index',['id'=>$v['id']])}}')">
                                        <img src="{{asset('storage/'.$v['thumb'])}}">
                                        <p class="mui-slider-title mui-ellipsis">{{$v['post_title']}}</p>
                                    </a>
                                </div>
                            @endforeach
                        <!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
                            <div class="mui-slider-item mui-slider-item-duplicate">
                                <a href="javascript:aOfApp('{{route('app.post-index',['id'=>$slide[0]['id']])}}')">
                                    <img src="{{asset('storage/'.$slide[0]['thumb'])}}">
                                    <p class="mui-slider-title mui-ellipsis">{{$slide[0]['post_title']}}</p>
                                </a>
                            </div>
                        @endif
                    </div>
                    <div class="mui-slider-indicator mui-text-center">
                        @if($slide)
                            @foreach($slide as $k=>$v)
                                @if($loop->first)
                                    <div class="mui-indicator mui-active"></div>
                                @else
                                    <div class="mui-indicator"></div>
                                @endif
                            @endforeach
                        @endif
                    </div>
                </div>
                <script type="text/javascript" charset="utf-8">
                    var gallery = mui('.mui-slider');
                    gallery.slider({
                        interval:5000//自动轮播周期，若为0则不自动播放，默认为0；
                    });
                </script>
            </div>
            <div class="line"></div>
            <div class="" style="">
                <div class="" >

                <ul class="mui-table-view company-list" id="list">

                </ul>
                </div>
            </div>
        </div>
        </div>
    </div>
@endsection
@section('foot')
    @include('.app.partial.loadjs',['cat_id'=>19])

@endsection
